/**
 * @param {number[]} cards
 * @return {number}
 */
var minimumCardPickup = function (cards) {
  let map = new Map()
  let result = cards.length+1
  for(index in cards){
    if(map.has(cards[index])){
      result = Math.min(result,index-map.get(cards[index]))
      map.set(cards[index],index)
    }else {
      map.set(cards[index],index)
    }
  }
  return result==cards.length+1?-1:result
}


let arr = ['a','b','c']
for(const  in arr){
  console.log(k+'----'+v);
}